<div class="module-setting">
    <ol class="breadcrumb fn-clearfix">
        <li>网站维护</li>
        <li>忠诚计划</li>
    </ol>
    <div class="ui-box">
        <form class="form-horizontal" role="form">
            <div class="form-group">
                <label for="assetCode" class="control-label">忠诚计划配置</label>
            </div>
            <div class="form-group">
                <label for="webUrl" class="col-sm-2 control-label">币种类型</label>
                <div class="col-sm-3">
                    <select class="form-control" ng-model="vm.form.ASSETCODES" id="assetCode2">
                        <option value="">请选择</option>
                        <option value="{{item.value}}"
                                ng-repeat="item in $root.$coinList">
                            {{item.label}}
                        </option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label for="webUrl" class="col-sm-2 control-label">计划类型</label>
                <div class="col-sm-3">
                    <select class="form-control" ng-model="vm.form.TRANSACTIONDAY">
                        <option value="">请选择</option>
                        <option value="30" selected>30天定期</option>
                        <option value="60">60天定期</option>
                        <option value="90">90天定期</option>
                    </select>
                </div>
            </div>
            <div class="form-group" >
                <label for="webUrl" class="col-sm-2 control-label">年化收益率</label>
                <div class="col-sm-3">
                    <input type="text" class="form-control" ng-model="vm.form.ANNUALIZEDYIELD" maxlength="20" placeholder="请输入年化收益率" />
                </div>
                <span style="margin-top: 8px;display: inline-block" >%</span>
            </div>
            <div class="form-group">
                <label for="webUrl" class="col-sm-2 control-label">最低起投</label>
                <div class="col-sm-3">
                    <input type="text" class="form-control" ng-model="vm.form.MINIMUMLIFTING" maxlength="20" placeholder="请输入起投" />
                </div>
            </div>
            <div class="form-group">
                <label for="webUrl" class="col-sm-2 control-label">限购数量</label>
                <div class="col-sm-1">
                    <input type="text" class="form-control" ng-model="vm.UNLOCK_NUM_PERCENT[0]" maxlength="20" placeholder="请输入最低限购数量" />
                </div>
                <div class="col-sm-1">
                    <input type="text" style="text-align: center;" class="form-control" value="-" disabled />
                </div>
                <div class="col-sm-1">
                    <input type="text" class="form-control" ng-model="vm.UNLOCK_NUM_PERCENT[1]" maxlength="20" placeholder="请输入最高限购数量" />
                </div>

            </div>
            <div class="form-group">
                <label for="webUrl" class="col-sm-2 control-label">项目方账户</label>
                <div class="col-sm-3">
                    <input type="text" class="form-control" ng-model="vm.form.USERID" maxlength="10" placeholder="请输入账户" />
                </div>
            </div>
            <div class="form-group ui-input-select" style="margin-left:290px;">
                <button type="submit"
                        style="width: 300px;"
                        class="btn btn-primary form-btn"
                        ng-click="vm.submit()">确认修改</button>
            </div>
        </form>
    </div>

</div>
<!--<div class="module-trade">
    <div class="panel panel-warning">
        <div class="panel-body">
            <form class="form-inline ui-form" role="form">
                <div class="form-group ui-input-select">
                    <label for="record-uid" class="control-label f-12">指定用户：</label>
                    <input type="text" class="form-control " placeholder="UID" ng-model="vm.condition.uid" id="record-uid">
                </div>
                <div class="form-group ui-input-select">
                    <label for="record-uid" class="control-label f-12">币种选择：</label>
                    <select class="form-control" ng-model="vm.condition.assetCode" ng-change="vm.changeAssetCode()">
                        <option ng-repeat="item in $root.$coinList" ng-value="item.value" >{{item.label}}</option>
                    </select>
                </div>

                <div class="form-group">
                    <span class="description" style="font-size: 16px;"></span>
                </div>
                <div class="form-group">
                    <button type="submit"  class="btn btn-primary" ng-click="vm.fetchList()">搜索</button>

                </div>


            </form>
        </div>
    </div>
</div>-->
<div class="module-trade">
    <div class="form-group">
        <label for="assetCode" class="control-label">所有计划配置<!--<span style="color:red">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*当前列表对象为搜索对象，默认对象为所有用户</span>--></label>
    </div>
    <div class="ui-box">
        <table class="table table-striped table-hover table-bordered">
            <thead>
            <tr>
                <th>配置币种</th>
                <th>项目方账户</th>
                <th>计划类型</th>
                <th>年化收益率</th>
                <th>最低起投</th>
                <th>限购数量</th>
                <th>剩余购买数量</th>
                <th>状态</th>
                <th>操作</th>
            </tr>
            </thead>
            <tbody>
            <tr ng-repeat="item in vm.list" ng-if="vm.isLoading === false && vm.list.length > 0">
                <td>{{item.assetCode}}</td>
                <td>{{item.uid}}</td>
                <td>{{item.transactionDay}}天定期</td>
                <td>{{item.annualizedYield}}%</td>
                <td>{{item.minimumLifting}}</td>
                <td>{{item.limitNumber}}</td>
                <td>{{item.surplusNumber}}</td>
                <td ng-class="{
                            greentradedetail:(item.status=='ALREADY_ONLINE'),
                            redtradedetail:(item.status=='NOT_ON_LINE'),
                            orangetradedetail:(item.status=='FINISHED')}">
                    {{item.status == 'NOT_ON_LINE' ? '未上线' : item.status ==
                    'ALREADY_ONLINE' ? '已上线' : '已完成'}}
                </td>
                <td>
                    <a href="javascript:;" ng-if="item.status == 'NOT_ON_LINE'" ng-click="vm.showPlanAllocationById(item.id)">修改</a>
                    <a href="javascript:;" ng-if="item.status == 'ALREADY_ONLINE'" ng-click="vm.showPlanAllocationById(item.id)">修改</a>
                    <a href="javascript:;" ng-class="{
                            greentradedetail:item.status== 'NOT_ON_LINE',
                            redtradedetail:item.status== 'ALREADY_ONLINE'}">
                    </a>
                    <a href="javascript:;" ng-if="item.status == 'NOT_ON_LINE'" ng-click="vm.createUplanallocation(item)">未上线</a>
                    <a href="javascript:;" ng-if="item.status == 'ALREADY_ONLINE'" ng-click="vm.createUplanallocation(item)">已上线</a>
                </td>
            </tr>
            </tbody>
        </table>

        <div class="ui-pager-box" ng-if="vm.totalNum > 0">
            <ul uib-pagination previous-text="上一页" next-text="下一页" first-text="首页" last-text="尾页" total-items="vm.totalNum" ng-model="vm.condition.pageNo"
                max-size="5" items-per-page="vm.pageSize || 10" align="right" class="pagination" boundary-links="true" ng-change="vm.pageChanged()"
                rotate="false"></ul>
        </div>
    </div>
</div>
